package cn.itcast.service.cargo.impl;

import cn.itcast.dao.cargo.ContractDao;
import cn.itcast.domain.cargo.Contract;
import cn.itcast.service.cargo.ContractService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ContractServiceImpl implements ContractService {
    @Autowired
    private ContractDao contractDao;
    @Override
    public PageInfo findByPageId(int pageNum, int pageSize, String id) {
        //1.设置分页参数
        PageHelper.startPage(pageNum,pageSize);
        //2.查询所有数据
        List<Contract> list = contractDao.findAll(id);
        //3.封装PageInfo
        return  new PageInfo<>(list);

    }
}
